import React, { Component } from 'react'
import Shuru from './components/shuru'

export default class App extends Component {
  username = React.createRef();
  password = React.createRef();
  render() {
    return (
      <div>
          <Shuru label='用户名:' type='text' ref={this.username}></Shuru>
          <Shuru label='密码:' type='password' ref={this.password}></Shuru>
          <button onClick={()=>{
            console.log(this.username.current.state.value, this.password.current.state.value);
            localStorage.setItem("username",this.username.current.state.value);
            localStorage.setItem("password",this.password.current.state.value);
          }}>提交</button>
          <button onClick={()=>{
            this.username.current.clear();
            this.password.current.clear();
          }}>重置</button>
      </div>
    )
  }
}
